/***** PROJECTED METHOD CODE *****/
/*****  Alexandre GAILLARD   *****/
/*   This version :: June 2017   */
/*********************************/


/***** USEFUL FUNCTIONS *****/
void bascule2E(double *VectorIN, double *VectorOUT, int TT){
    int igrid, tgrid, egrid;
    
    for(igrid=0; igrid<maxgrid; igrid++){
        for(tgrid=0; tgrid<maxtheta; tgrid++){
            for(egrid=0; egrid<maxfirmtype; egrid++){
                VectorOUT[inxTPE(TT, igrid, tgrid, egrid)]=VectorIN[inxE(igrid, tgrid, egrid)];
            }
        }
    }
}

void bascule2W(double *VectorIN, double *VectorOUT, int TT){
    int igrid, tgrid, ygrid;
    for(igrid=0; igrid<maxgrid; igrid++){
        for(tgrid=0; tgrid<maxtheta; tgrid++){
            for(ygrid=0; ygrid<maxyprod; ygrid++){
                VectorOUT[inxTPW(TT, igrid, tgrid, ygrid)]=VectorIN[inxW(igrid, tgrid, ygrid)];
            }
        }
    }
}

    
void bascule2(double *VectorIN, double *VectorOUT, int TT){
    int igrid, tgrid;
    for(igrid=0; igrid<maxgrid; igrid++){
        for(tgrid=0; tgrid<maxtheta; tgrid++){
            VectorOUT[inxTP(TT, igrid, tgrid)]=VectorIN[inx(igrid, tgrid)];
        }
    }
}

void bascule3E(double *VectorIN, double *VectorOUT, int TT){
    int igrid, tgrid, egrid;
    for(igrid=0; igrid<maxgrid; igrid++){
        for(tgrid=0; tgrid<maxtheta; tgrid++){
            for(egrid=0; egrid<maxfirmtype; egrid++){
                VectorOUT[inxE(igrid, tgrid, egrid)]=VectorIN[inxTPE(TT, igrid, tgrid, egrid)];
            }
        }
    }
}

void bascule3W(double *VectorIN, double *VectorOUT, int TT){
    int igrid, tgrid, ygrid;
    
    for(igrid=0; igrid<maxgrid; igrid++){
        for(tgrid=0; tgrid<maxtheta; tgrid++){
            for(ygrid=0; ygrid<maxyprod; ygrid++){
                VectorOUT[inxW(igrid, tgrid, ygrid)]=VectorIN[inxTPW(TT, igrid, tgrid, ygrid)];
            }
        }
    }
}

void bascule3(double *VectorIN, double *VectorOUT, int TT){
    int igrid, tgrid;
    for(igrid=0; igrid<maxgrid; igrid++){
        for(tgrid=0; tgrid<maxtheta; tgrid++){
            VectorOUT[inx(igrid, tgrid)]=VectorIN[inxTP(TT, igrid, tgrid)];
        }
    }
}



